package com.wimcorp.magic.abilities.trigger;

import javax.persistence.Entity;

import com.wimcorp.magic.abilities.Ability;
import com.wimcorp.magic.cards.Creature;

@Entity
public class OnCombatDamageToCreature extends AbilityTrigger {

	public OnCombatDamageToCreature() {
	}

	public OnCombatDamageToCreature(Ability ability){
		super(ability);
	}

	public OnCombatDamageToCreature(OnCombatDamageToCreature abilityTrigger) {
		super(abilityTrigger);
	}
	
	@Override
	public void register() {
		((Creature)getAbility().getCard()).registerCreatureDamageListener(getAbility());
		
	}
	
	@Override
	public void unRegister() {
		((Creature)getAbility().getCard()).unRegisterCreatureDamageListener(getAbility());
	}
	
	public OnCombatDamageToCreature clone() {
		return new OnCombatDamageToCreature(this);
	}

}
